#ifndef PROTREETHREAD_H
#define PROTREETHREAD_H

#include<QThread>
#include<QTreeWidgetItem>

class ProTreeThread : public QThread
{
    Q_OBJECT
public:
    ProTreeThread(const QString &src_path, const QString &dist_path, QTreeWidgetItem* parent_item,
    int file_count, QTreeWidget *self, QTreeWidgetItem* root, QObject *parent = nullptr);
    ~ProTreeThread();
protected:
    virtual void run();
private:
    void CreateProTree(const QString &src_path, const QString &dist_path, QTreeWidgetItem *parent_item,
        int &file_count, QTreeWidget *self, QTreeWidgetItem* root, QTreeWidgetItem *pre_item = nullptr);
    QString _src_path;
    QString _dist_path;
    int _file_count;
    QTreeWidgetItem *_parent_item;
    QTreeWidget* _self;
    QTreeWidgetItem* _root;
    bool _bstop;
public slots:
    void SlotCancleProgress();
signals:
    void SigUpdateProgress(int);
    void SigFinishProgress(int);
};

#endif // PROTREETHREAD_H
